

Namespace Aricie.DNN.Caching.Analysis
    <Serializable()> _
    Public Class CacheDiagnostic


        Private _SortedDistributionTypes As New List(Of KeyDistributionStatistic)
        Private _UsualPrevKey As KeySequenceStat
        Private _UsualNextKey As KeySequenceStat

        Public Property SortedDistributionTypes() As List(Of KeyDistributionStatistic)
            Get
                Return _SortedDistributionTypes
            End Get
            Set(ByVal value As List(Of KeyDistributionStatistic))
                _SortedDistributionTypes = value
            End Set
        End Property

        Public Property UsualPrevKey() As KeySequenceStat
            Get
                Return _UsualPrevKey
            End Get
            Set(ByVal value As KeySequenceStat)
                _UsualPrevKey = value
            End Set
        End Property


        Public Property UsualNextKey() As KeySequenceStat
            Get
                Return _UsualNextKey
            End Get
            Set(ByVal value As KeySequenceStat)
                _UsualNextKey = value
            End Set
        End Property

        'Public Shared Function GetTimingsFromDistrib(ByVal distributionType As CacheDistributionType) As CacheTimings
        '    Select Case distributionType
        '        Case CacheDistributionType.NotDistributed
        '            Return CacheTimings.CreateObject
        '        Case CacheDistributionType.Serialized, CacheDistributionType.XmlSerialized, CacheDistributionType.NativeBinary, CacheDistributionType.AsString
        '            Return CacheTimings.DistributedCachingGet
        '        Case CacheDistributionType.Undefined
        '            Return CacheTimings.Init
        '    End Select
        'End Function


        'Public Shared Function GetCorrespondingTiming(ByVal keyStat As CacheKeyStatistics, ByVal distributionType As CacheDistributionType) As TimeSpan
        '    Dim tempSeries As Series(Of STimeSpan) = Nothing
        '    Dim toReturn As TimeSpan = TimeSpan.Zero
        '    Dim targetTiming As CacheTimings = GetTimingsFromDistrib(distributionType)
        '    For Each objTiming As CacheTimings In Common.GetEnumMembers(Of CacheTimings)()
        '        If (objTiming And targetTiming) = objTiming Then
        '            If keyStat.Timings.TryGetValue(objTiming, tempSeries) Then
        '                toReturn += tempSeries.Mean.Value
        '            Else
        '                Return TimeSpan.MaxValue
        '            End If
        '        End If
        '    Next
        '    Return toReturn

        'End Function

    End Class
End Namespace